<?php
$companyid = PFactory::getMasterUser()->id;
$folderList = PJobpositionHelper::getCustomFolderList($companyid, 0, 'user', true);
$reportsFolderList = PJobpositionHelper::getCustomFolderList($companyid, 0, $_['type'], true);
$jobcityList = PResumesHelper::getJobCityList($companyid);
$alljobsUrl = PResumesHelper::getSearchItemHref($_['url'], 'fid', 'all')[0];
list($selectedTitle, $curcityids) = PReportsHelper::getJobDropTitle($_['fid'], $companyid, $_['type']);
if (empty($selectedTitle)) {
   $app = PFactory::getApplication();
   $app->redirect($alljobsUrl);
   return true;
}
?>
<div class="resume_search fixed_resume_search clearfix"><div class="rep_navmenubox medium"><b>当前所选职位：</b><em><?=$selectedTitle;?></em></div></div>
<div class="highsearch_eachbox medium clearfix folderSelect">
   <label class="key pull-left">文件夹：</label>
   <ul style="margin-left:70px; display:block;">
      <li class="<?=(empty($_['fid']) ? 'cur_selected' : '')?>"><a data-fid="0" class="folder" href="javascript:;">全部职位</a></li>
      <?
      if (!empty($folderList)) {
         foreach ($folderList as $f) {
            echo '<li class="line">|</li><li class="' . ($_['fid'] == $f->folder_id ? 'cur_selected' : '') . '"><a data-fid="'.$f->folder_id.'" class="folder" href="javascript:;">' . $f->folder_name . '</a></li>';
         }
      }
      ?>
   </ul>
</div>
<div id="citySelect" class="highsearch_eachbox medium clearfix">
   <label class="key pull-left">地区：</label>
   <ul style="margin-left:70px; display:block;">
      <?
      if (!empty($jobcityList)) {
         $cityhtml = array();
         foreach ($jobcityList as $c) {
            $cityhtml[] = '<li class="' . (in_array($c['cityid'], $curcityids) ? 'cur_selected' : '') . '"><a data-cityid="' . $c['cityid'] . '" class="city" href="javascript:;">' . (ProvinceHelper::getMuniProvinceId($c['cityid']) ? $c['province'] : $c['province'] . $c['city']) . '</a></li>';
         }
         echo implode('<li class="line">|</li>', $cityhtml);
      }
      ?>
   </ul>
</div>
<div class="highsearch_eachbox medium clearfix folderSelect">
   <label class="key pull-left">自定义：</label>
   <?
   if (!empty($reportsFolderList)) {
      echo '<ul style="margin-left:70px; display:block; margin-bottom:8px;">';
      $jobgrouphtml = array();
      foreach ($reportsFolderList as $f) {
         $jobgrouphtml[] = '<li class="' . ($_['fid'] == $f->folder_id ? 'cur_selected' : '') . '"><a data-fid="'.$f->folder_id.'" class="folder ' . ($f->folder_name == '常用组合' ? 'prev_postip ' : '') . '" href="javascript:;">' . $f->folder_name . '</a></li>';
      }
      echo implode('<li class="line">|</li>', $jobgrouphtml);
      echo '</ul>';
   }
   ?>
   <ul style="margin-left:70px; display:block;">
      <li><a href="javascript:;" class="create_group" id="createJobGroup" style="margin-right:8px;"><i class="i_cp"></i> 新建职位组</a></li>
      <? if(!empty($reportsFolderList)): ?>
         <li><a href="javascript:;" class="create_group" id="manageJobGroup"><i class="i_cg"></i> 管理职位组</a></li>
      <? endif; ?>
   </ul>
</div>
